package com.telephone.purchase.dao;

import com.telephone.purchase.entity.Order;
import com.telephone.purchase.entity.User;
import com.telephone.purchase.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author fengyingeng
 * @date 2019/9/5 9:50
 * Description:
 */
@Repository
public class OrderDao {


    @Autowired
    private OrderMapper orderMapper;

    public List<Order> getListInfo(String phoneNumber) {

        List<Order> list = null;

        try {
            list = orderMapper.selectList(phoneNumber);
        } catch (Exception e) {
           e.printStackTrace();
        }
        return list;
    }

    public Long getGoodId(Long packageId){

        Long goodId = 0l;

        try {
            goodId = orderMapper.selectGoodId(packageId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return goodId;
    }

    public String getGoodUrl(Long goodId){

        String goodUrl = null;

        try {
            goodUrl = orderMapper.selectGoodUrl(goodId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return goodUrl;
    }
}
